<script>
import { useRouter } from "vue-router";
import { useIndex } from "../stores/index.js";
import { computed } from "vue";
import { Toast } from "vant";
export default {
  setup() {
    const indexStore = useIndex();
    indexStore.changeSideLeftMeShow(false);
    const router = useRouter();
    let back = () => {
      router.back();
      // router.push("/BookCase");
    };
    // 详情页跳转
    let details = (id) => {
      router.push({ path: "/Details", query: { id: id } });
    };

    return {
      toast: Toast,
      details,
      back,
      SideLeftMeShow: computed(() => indexStore.SideLeftMeShow),
    };
  },
};
</script> 


<template>
  <div class="authorView">
    <div class="head">
      <div class="back" @click="back">
        <div class="svg">
          <svg
            t="1669733532823"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="8451"
            width="200"
            height="200"
          >
            <path
              d="M761.248866 208.843017 461.531611 512.526663l299.717255 303.68851c9.265857 9.259775 16.212208 19.845329 20.84392 31.756662 4.629279 11.906468 6.946352 23.984435 6.946352 36.224172 0 12.23852-2.317072 24.148637-6.946352 35.729133-4.631712 11.573198-11.578064 21.998199-20.84392 31.256758-18.524415 19.189737-40.689249 28.782782-66.492069 28.782782-25.804036 0-47.96887-9.593044-66.493285-28.782782L266.024226 585.971165c-9.259775-9.26464-16.539396-20.344016-21.831565-33.249075-5.293385-12.898977-8.272131-25.969454-8.932587-39.201701-0.660457-13.23103 0.993726-25.965806 4.960116-38.209191 3.972471-12.239737 10.585554-22.326603 19.851411-30.265465l368.190695-371.16944c18.523199-18.525632 40.689249-27.790272 66.493285-27.790272 25.80282 0 47.967654 9.26464 66.492069 27.790272 9.265857 9.259775 16.212208 19.845329 20.84392 31.756662 4.629279 11.906468 6.946352 23.984435 6.946352 36.222955 0 12.239737-2.317072 24.15107-6.946352 35.729133C777.461074 189.159458 770.514723 199.583242 761.248866 208.843017L761.248866 208.843017zM761.248866 208.843017"
              p-id="8452"
              fill="#ff3c6c"
            ></path>
          </svg>
        </div>
      </div>
      <div class="title">作者专区</div>
      <div class="back"></div>
    </div>
    <div class="body">
      <!-- 斗罗大陆 -->
      <div class="warpitem">
        <div class="item" @click="toast('他的作品都在这儿~')">
          <div class="imgs">
            <img src="../assets/authorimg/作者.png" alt="" />
          </div>
          <div class="right">
            <div class="name">唐家三少</div>
            <div class="howmany">本站收录6本</div>
          </div>
          <div class="go">
            <svg
              t="1669720753370"
              class="icon"
              viewBox="0 0 1024 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="3600"
              width="200"
              height="200"
            >
              <path
                d="M658.56 557.392L322.536 221.384l45.248-45.256 336.016 336.008z"
                p-id="3601"
                fill="#8a8a8a"
              ></path>
              <path
                d="M704.088 512.2L364.12 852.16l-45.256-45.248 339.976-339.976z"
                p-id="3602"
                fill="#8a8a8a"
              ></path>
            </svg>
          </div>
        </div>
        <div class="body">
          <div class="lunbo">
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗罗.png" alt="" />
              </div>
              <div class="name">斗罗大陆1</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗罗2.png" alt="" />
              </div>
              <div class="name">斗罗大陆2</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗罗3.png" alt="" />
              </div>
              <div class="name">斗罗大陆3</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗罗4.png" alt="" />
              </div>
              <div class="name">斗罗大陆4</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗罗5.png" alt="" />
              </div>
              <div class="name">斗罗大陆5</div>
            </div>
          </div>
        </div>
      </div>
      <!-- 偷星九月天 -->
      <div class="warpitem">
        <div class="item" @click="toast('他的作品都在这儿~')">
          <div class="imgs">
            <img src="../assets/authorimg/作者3.png" alt="" />
          </div>
          <div class="right">
            <div class="name">周洪滨</div>
            <div class="howmany">本站收录4本</div>
          </div>
          <div class="go">
            <svg
              t="1669720753370"
              class="icon"
              viewBox="0 0 1024 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="3600"
              width="200"
              height="200"
            >
              <path
                d="M658.56 557.392L322.536 221.384l45.248-45.256 336.016 336.008z"
                p-id="3601"
                fill="#8a8a8a"
              ></path>
              <path
                d="M704.088 512.2L364.12 852.16l-45.256-45.248 339.976-339.976z"
                p-id="3602"
                fill="#8a8a8a"
              ></path>
            </svg>
          </div>
        </div>
        <div class="body">
          <div class="lunbo">
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/九月.png" alt="" />
              </div>
              <div class="name">偷星九月天1</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/九月2.png" alt="" />
              </div>
              <div class="name">偷星九月天2</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/九月3.png" alt="" />
              </div>
              <div class="name">偷星九月天3</div>
            </div>
          </div>
        </div>
      </div>
      <!-- 斗破苍穹 -->
      <div class="warpitem">
        <div class="item" @click="toast('他的作品都在这儿~')">
          <div class="imgs">
            <img src="../assets/authorimg/作者2.png" alt="" />
          </div>
          <div class="right">
            <div class="name">天蚕土豆</div>
            <div class="howmany">本站收录6本</div>
          </div>
          <div class="go">
            <svg
              t="1669720753370"
              class="icon"
              viewBox="0 0 1024 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="3600"
              width="200"
              height="200"
            >
              <path
                d="M658.56 557.392L322.536 221.384l45.248-45.256 336.016 336.008z"
                p-id="3601"
                fill="#8a8a8a"
              ></path>
              <path
                d="M704.088 512.2L364.12 852.16l-45.256-45.248 339.976-339.976z"
                p-id="3602"
                fill="#8a8a8a"
              ></path>
            </svg>
          </div>
        </div>
        <div class="body">
          <div class="lunbo">
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗破.png" alt="" />
              </div>
              <div class="name">斗破苍穹1</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗破2.png" alt="" />
              </div>
              <div class="name">斗破苍穹2</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/斗破3.png" alt="" />
              </div>
              <div class="name">斗破苍穹3</div>
            </div>
          </div>
        </div>
      </div>
      <!-- 进击的巨人 -->
      <div class="warpitem">
        <div class="item" @click="toast('他的作品都在这儿~')">
          <div class="imgs">
            <img src="../assets/authorimg/作者4.png" alt="" />
          </div>
          <div class="right">
            <div class="name">谏山创</div>
            <div class="howmany">本站收录6本</div>
          </div>
          <div class="go">
            <svg
              t="1669720753370"
              class="icon"
              viewBox="0 0 1024 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="3600"
              width="200"
              height="200"
            >
              <path
                d="M658.56 557.392L322.536 221.384l45.248-45.256 336.016 336.008z"
                p-id="3601"
                fill="#8a8a8a"
              ></path>
              <path
                d="M704.088 512.2L364.12 852.16l-45.256-45.248 339.976-339.976z"
                p-id="3602"
                fill="#8a8a8a"
              ></path>
            </svg>
          </div>
        </div>
        <div class="body">
          <div class="lunbo">
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/巨人.png" alt="" />
              </div>
              <div class="name">进击的巨人1</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/巨人2.png" alt="" />
              </div>
              <div class="name">进击的巨人2</div>
            </div>
            <div class="books" @click="details(104216)">
              <div class="imgs">
                <img src="../assets/authorimg/巨人3.png" alt="" />
              </div>
              <div class="name">进击的巨人3</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 撑开 -->
    <div class="nothing"></div>
  </div>
</template>



<style lang="scss">
.authorView {
  width: 100%;
  height: 100%;
  padding-top: 50px;
  box-sizing: border-box;

  .head {
    position: fixed;
    top: 0;
    box-sizing: border-box;
    padding: 0 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    background-color: #fff;
    box-shadow: 0 -1px 2px 2px rgba($color: #000000, $alpha: 0.1);
    z-index: 10;
    .back {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      overflow: hidden;
      .svg {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        svg {
          color: #eee;
          width: 60%;
          height: 60%;
        }
      }
    }
    .title {
      width: 100%;
      font-size: 16px;
      font-weight: bold;
      text-align: center;
      line-height: 50px;
    }
  }
  .body {
    width: 100%;
    .warpitem {
      width: 100%;
      margin-bottom: 20px;
      overflow: hidden;

      .item {
        width: 100%;
        height: 70px;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        background-color: #fff;
        border-bottom: 1px solid #ecebeb;
        .go {
          width: 50px;
          height: 50px;
          display: flex;
          align-items: center;
          justify-content: center;
          svg {
            width: 20px;
            height: 20px;
          }
        }
        .imgs {
          width: 50px;
          height: 50px;
          border-radius: 50%;
          overflow: hidden;
          margin-left: 20px;
          img {
            width: 100%;
          }
        }
        .right {
          flex: 1;
          height: 50px;
          margin-left: 10px;
          .name {
            font-size: 14px;
            font-weight: 600;
            width: 100%;
            height: 25px;
            line-height: 25px;
          }
          .howmany {
            width: 100%;
            height: 25px;
            font-size: 12px;
            line-height: 25px;
            color: #999;
          }
        }
      }
      .body {
        width: 100%;
        overflow-x: scroll;
        &::-webkit-scrollbar,
        &::-webkit-scrollbar-thumb {
          width: 0;
          height: 0;
        }
        .lunbo {
          width: max-content;
          display: flex;

          .books {
            width: 100px;
            height: 170px;
            display: flex;
            background-color: #fff;
            flex-direction: column;
            margin: 10px 13px 0;
            border-radius: 5px;
            .imgs {
              width: 100%;
              border-radius: 5px;
              overflow: hidden;
              box-shadow: 2px 2px 6px 1px rgb(0 0 0 / 20%);
              img {
                width: 100%;
              }
            }
            .name {
              text-indent: 5px;
              width: 100%;
              font-size: 12px;
              height: 30px;
              line-height: 30px;
            }
          }
        }
      }
    }
  }
}
.author .body .warpitem .body::-webkit-scrollbar,
.author .body .warpitem .body::-webkit-scrollbar-thumb {
  width: 0;
  height: 0;
}
</style>